package com.bw.service.impl;

import com.bw.domain.ParkManager;
import com.bw.mapper.ParkManagerMapper;
import com.bw.service.ParkManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author bobo棒
 * @date 2025年02月27日 14:40
 */

@Service
public class ParkManagerServiceImpl implements ParkManagerService {
    @Autowired
    ParkManagerMapper parkManagerMapper;
    @Override
    public List<ParkManager> list(ParkManager parkManager) {
        return parkManagerMapper.list(parkManager);
    }

    @Override
    public int addOrUpdate(ParkManager parkManager) {
        //如果主键为空则表示增加
        if(parkManager.getId()==null){
            return parkManagerMapper.add(parkManager);
        }else{
            //主键有值则表示修改
            return parkManagerMapper.update(parkManager);
        }



    }
}
